package com.hiwhitley.easy.day15;

/**
 * Created by hiwhitley on 2016/8/22.
 */
public class IsPalindrome {
    public boolean isPalindrome(int x) {
        if (x < 0) return false;
        int temp = x;
        int rev = 0;
        while (x != 0) {
            rev = rev * 10 + x % 10;
            x = x / 10;
        }
        return rev == temp;
    }
}
